/**
 * PictureComment.java
 *
 *
 * $LastChangedBy: allen $
 * $LastChangedDate: 2007-12-07 15:48:57 +0800 $
 * $Revision: 1400 $
 */
package com.myspace.domain;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;

@Entity(name = "PictureComment")
@Table(name = "PIC_COMMENTS")
public class PictureComment extends DomainObject {

	private static final long serialVersionUID = 20071116L;

	private Long id;

	private Long picId;

	private String content;

	private Long createUser;

	private Date createDate;

	// private Picture picture;

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO, generator = "seq_pic_comments")
	@SequenceGenerator(name = "seq_pic_comments", sequenceName = "SEQ_PIC_COMMENTS")
	public Long getId() {
		return id;
	}

	void setId(Long id) {
		this.id = id;
	}

	@Column(name = "PIC_ID")
	public Long getPicId() {
		return picId;
	}

	public void setPicId(Long picId) {
		this.picId = picId;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	@Column(name = "CREATE_USER")
	public Long getCreateUser() {
		return createUser;
	}

	public void setCreateUser(Long createUser) {
		this.createUser = createUser;
	}

	@Column(name = "CREATE_DATE")
	@Temporal(TemporalType.TIMESTAMP)
	public Date getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	@Override
	@Transient
	public boolean isPersistence() {
		return id != null;
	}

	// @ManyToOne(fetch = FetchType.EAGER)
	// @JoinColumn(name = "PIC_ID", referencedColumnName = "ID", nullable =
	// false, updatable = false)
	// public Picture getPicture() {
	// return picture;
	// }
	//
	// public void setPicture(Picture picture) {
	// this.picture = picture;
	// }

}
